package ipad.asia.dao;


import ipad.asia.entity.Product;
import ipad.asia.entity.ProductCopy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProductCopyDao extends JpaRepository<ProductCopy,Long> {
   ProductCopy findById(int id);  //根据id查询
    void deleteById(int id); //通过id删除
   List<ProductCopy> findByShopId(int ShopId);

    @Modifying
    @Query("update ProductCopy set number=?1 where id=?2")
    void updateNumber(int number,int id);

}
